package com.yfp.device.mapper;

import cn.hutool.core.date.DateTime;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yfp.device.domain.OrderListExample;
import com.yfp.device.domain.OrderList;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface OrderListMapper extends BaseMapper<OrderList> {
    long countByExample(OrderListExample example);

    int deleteByExample(OrderListExample example);


    int insertSelective(OrderList record);

    List<OrderList> selectByExample(OrderListExample example);

    int updateByExampleSelective(@Param("record") OrderList record, @Param("example") OrderListExample example);

    int updateByExample(@Param("record") OrderList record, @Param("example") OrderListExample example);

    /**
     * 状态为支付的订单
     *
     * @param orderId
     * @return
     */
    List<OrderList> getByPayOrderId(String orderId);

    /**
     * 修改出餐货道
     *
     * @param id
     * @param machineRoadNo
     */
    void updateMachineRoadNo(@Param("id") String id, @Param("machineRoadNo") String machineRoadNo);

    List<String> getByMachineIdAndStatus(String machineSn);

    /**
     * 修改订单状态
     *
     * @param orderDetailId
     */
    void updateOrderStatus(String orderDetailId);

    /**
     * 根据详情id获取订单信息
     *
     * @param orderDetailId
     * @return
     */
    OrderList getById(String orderDetailId);

    /**
     * 根据订单id获取订单信息
     *
     * @param orderId
     * @return
     */
    List<OrderList> getByOrderId(String orderId);

    void updateFinishTimeByOrderDetailId(@Param("orderDetailId") String orderDetailId, @Param("exitCloseTime") DateTime exitCloseTime);
}